package com.yty.demo._5_exception;

import java.rmi.RemoteException;

/**
 * @author: yangtaoyao
 * @time: 2020/1/13 9:37
 * @description: 异常
 */
public class ExceptTest{

    public static void main(String args[]){
        System.out.println(test());
    }

    public void deposit(double amount) throws RemoteException
    {
        // Method implementation
        throw new RemoteException();
    }

    public static int test(){
        int a[] = new int[2];
        try{
            System.out.println("Access element three :" + a[3]);
            return 0;
        }catch(ArrayIndexOutOfBoundsException e){
            return -1;
        } finally{
            return 1;
        }
    }
}
